import query from '@dfeidao/atom-nodejs/db/query';
import { IncomingHttpHeaders } from 'http';
import { productid,systemid } from '../../atom/config';

interface Message {
	exam_id: string;
	// cookie: {
	// 	uk: string;
	// 	[key: string]: string
	// };
	// urls: {
	// 	base: string;
	// 	origin: string;
	// 	url: string;
	// };
	// query: {};
	// params: {};
	// headers: {};
	// captcha: string;
}
// 读表<考试管理 exam_management > 得到

// “考试编号 exam_id  ”

// “考试名称 exam_name ”

// “考试类别 examination_category ”

// “开始时间 start_time ”

// “结束时间 finish_time ”

// “试卷总分 exam_score  ”

// “考试时长 exam_time ”

// “考试说明 exam_explain ”

export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const pre = query(action_id, session_id, systemid);
	pre.prepare('exam_management',['exam_id','exam_name', 'examination_category','start_time','finish_time','exam_score','exam_score','exam_time','exam_explain'],
	 {productid,exam_id:message.exam_id},1,1,[],[]);
	 const [dt]= await pre.exec();
	return {dt};
}
